<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script type="text/javascript">
	CKEDITOR.replace("ckeditor");
	
</script>

</head>
<body>
<center>
<!-- CKEditor demo -->
<h3>CKEditor demo</h3>
<form action="content.jsp" method="post">
<p>
	 
	<textarea class="ckeditor" cols="100" id="ckeditor" name="ckeditor" rows="10">
		<p style="text-align: center;">
			<span style="font-size:24px;">这个是初始化内容<span style="color:#800080;"><b>CKEditor</b></span></span>
		</p>
	</textarea>

</p>
<p><input type="submit" /></p>
</form>

<hr>
<br>

<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shCore.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushBash.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushCpp.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushCSharp.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushCss.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushDelphi.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushDiff.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushGroovy.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushJava.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushJScript.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushPhp.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushPlain.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushPython.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushRuby.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushScala.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushSql.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushVb.js"></script>
<script type="text/javascript" src="ckeditor/plugins/insertcode/syntaxhighlighter/scripts/shBrushXml.js"></script>

<link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shCore.css"/>

<!-- 选择高亮主题 -->
<link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shThemeDefault.css"/>
<!-- <link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shThemeDjango.css"/> -->
<!-- <link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shThemeEmacs.css"/> -->
<!-- <link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shThemeFadeToGrey.css"/> -->
<!-- <link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shThemeMidnight.css"/> -->
<!-- <link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shThemeRDark.css"/> -->

<!-- <link type="text/css" rel="stylesheet" href="ckeditor/plugins/insertcode/syntaxhighlighter/styles/shThemeEclipse.css"/> -->


<script type="text/javascript">

	//如果你要高亮的内容位于blogger.com，那么你需要开启这个开关
	//SyntaxHighlighter.config.bloggerMode = true;
	
	SyntaxHighlighter.config.clipboardSwf = 'ckeditor/plugins/insertcode/syntaxhighlighter/scripts/clipboard.swf';
	
	//重新设置一些属性
	SyntaxHighlighter.config.strings.expandSource = "展开代码";
	SyntaxHighlighter.config.strings.viewSource = "查看代码"; 
	
	//是否显示行号
	SyntaxHighlighter.defaults['gutter'] = true;
	//是否折叠 
	//SyntaxHighlighter.defaults['collapse'] = true;
	
	//显示/隐藏工具栏  
	//SyntaxHighlighter.defaults['toolbar'] = true;
	
	//高亮显示HTML/XML代码
	//SyntaxHighlighter.defaults['html-script'] = true;
	
	//为代码块设置智能缩进（如果代码缩进不规范的）
	SyntaxHighlighter.defaults['smart-tabs'] = true;
	
	SyntaxHighlighter.all();
</script>
<h3>代码高亮显示Demo</h3>
<div style="border: #d1d7dc 1px solid;border-radius:5px; width: 70%;background-color: #fff; color: #2b91af" >
<pre class="brush:java;">
package cn.com.ajava.tool;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Properties;

/**
 * Properties util tool
 * @author zengfantian
 * @date 2011-03-01
 * @version 1.0
 */
@SuppressWarnings("serial")  
public final class  PropertiesTool extends Properties{

	private static String filePath ;
	private static Properties property = new Properties(); 
	
	@SuppressWarnings("unused")
	private PropertiesTool(){
		readProperties();
	}
	
	
	 //load the property
	 
	private static void readProperties(){ 
		try { 
			InputStream  is = new FileInputStream(filePath);
        	property.load(is); 
        	is.close();
        } catch (Exception e) { 
            e.printStackTrace(); 
        }
    } 

	/**
	 * set property's location
	 * @param name filePath
	 */
	public static void setFilePath(String name) {
		filePath = name;
	}
	/**
	 * get the Property of Property file where 
	 * locating at giving the filePath 
	 * @param filePath  filePath
	 * @param key key
	 * @return String value
	 * 
	 */
	public static final String getValueFromProperties(String filePath,String key)
	{
		String value = null;
		try 
		{
			setFilePath(filePath);
			readProperties();
			if(property.containsKey(key))
			{
				value = property.getProperty(key);
			}
		} catch (Exception e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}
		return value;
	}
	/**
	 * get the Property of Property <br>
	 * but you should set PropertiesTool's fileName before using it .<br>
	 * For example: <br>
	 * <p><blockquote><pre>
     * PropertiesTool.setFileName("config.properties");<br>
	 * String host = PropertiesTool.getValueFromProperties("host")
     * </pre></blockquote><p>
	 * @param key  key
	 * @return String value
	 */
	public static final String getValueFromProperties(String key)
	{
		String value = null;
		try {
			readProperties();
			if(property.containsKey(key))
			{
				value = property.getProperty(key);
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			System.out.println(e.getMessage());
			e.printStackTrace();
		}
		return value;
	}
	
	
	/**
	 * update Properties Value 
	 * @param filePath filePath
	 * @param key key
	 * @param value value
	 */
	public static final void updatePropertiesValue(String filePath, String key,String value) {
		Properties props = new Properties();
		try {
			InputStream fis = new FileInputStream(filePath);
			props.load(fis);
			fis.close();
			
			OutputStream fos = new FileOutputStream(filePath);
			props.setProperty(key, value);
			props.store(fos, "");
			fos.close();
		} catch (Exception e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}

	}
	
}
</pre>
</div>
</center>
</body>
</html>